import request from "@/utils/request.js"

export function getComment(params) {
    return request({
        method: 'GET',
        url: '/v1_0/comments',
        params
    })
}

// 对评论点赞
export function toLike(target) {
    return request({
        method: 'POST',
        url: '/v1_0/comment/likings',
        data: {
          target
        }
    })
}

// 取消对评论点赞
export function cancelLike(id) {
    return request({
        method: 'DELETE',
        url: '/v1_0/comment/likings/' + id
    })
}

// 添加评论
export function addComment(data) {
    return request({
        method: 'POST',
        url: '/v1_0/comments',
        data
    })
}
